package hidalgo.expenses.entities;

import java.util.Date;

import android.graphics.Bitmap;

public class Transaction {

	public static final int INCOME = 0;
	public static final int EXPENSE = 1;

	private int transactionId;
	private boolean isExpense;
	private int accountId;
	private Date date;
	private double amount;
	private int paymentMethodId;
	private Bitmap image;
	private String description;

	public Transaction(final int type) {
		init(type);
	}

	public Transaction(int transactionId, final int type, int accountId,
			Date date, double amount, int paymentMethodId) {

		this.setTransactionId(transactionId);
		this.accountId = accountId;
		this.date = date;
		this.amount = amount;
		this.paymentMethodId = paymentMethodId;

		init(type);

	}

	private void init(int type) {
		if (type == INCOME) {
			this.setExpense(false);
		} else if (type == EXPENSE) {
			this.setExpense(true);
		}
	}

	public boolean isExpense() {
		return isExpense;
	}

	public void setExpense(boolean isExpense) {
		this.isExpense = isExpense;
	}

	public double getAmount() {
		return amount;
	}

	public void setAmount(double amount) {
		this.amount = amount;
	}

	public int getPaymentMethodId() {
		return paymentMethodId;
	}

	public void setPaymentMethodId(int paymentMethodId) {
		this.paymentMethodId = paymentMethodId;
	}

	public int getAccountId() {
		return accountId;
	}

	public void setAccountId(int accountId) {
		this.accountId = accountId;
	}

	public Date getDate() {
		return date;
	}

	public void setDate(Date date) {
		this.date = date;
	}

	public Bitmap getImage() {
		return image;
	}

	public void setImage(Bitmap image) {
		this.image = image;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public int getTransactionId() {
		return transactionId;
	}

	public void setTransactionId(int transactionId) {
		this.transactionId = transactionId;
	}
}
